package demo_02;

/**
 * description: TestExtends <br>
 * date: 2022/1/30 9:14 下午 <br>
 * author: shesaifei <br>
 * version: 1.0 <br>
 */
public class TestExtends {
    public static void main(String[] args) {
        Student student = new Student();
        student.name = "zs";
        student.height = 1;
        student.major = "1001";
        student.study();
        student.rest();
        System.out.println(student.height);
    }
}

class Person {
    String name;
    int height;

    public void rest() {
        System.out.println("休息一会儿！");
    }
}

class Student extends Person {
    String major;

    public void study() {
        System.out.println("学习Java！");
    }
}